#include "dotitem.h"

DotItem::DotItem(GraphWidget *graphWidget)
    : graph(graphWidget)
{
    setZValue(-1);
}

QRectF DotItem::boundingRect() const
{
    qreal adjust = ADJUST;
    return QRectF(-DOTRADIUS-adjust*2, -DOTRADIUS-adjust*2,
                  DOTRADIUS*2+adjust*2, DOTRADIUS*2+adjust*2);
}

void DotItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    //TODO
    painter->setBrush(Qt::red);
    painter->setPen(Qt::NoPen);
    painter->drawRect(-DOTRADIUS, -DOTRADIUS,
                         DOTRADIUS*3, DOTRADIUS*3);
    painter->setPen(Qt::white);
    painter->drawPoint(0,0);
}
